<template>
	<div class="child">
		<h1>我是Child组件</h1>
		<h2>我有台电脑：{{computer}}</h2>
		<button @click="$emit('get-computer',computer)">把电脑交给父亲</button>
		<button @click="$off('get-computer')">解绑掉我身上的get-computer事件</button>
	</div>
</template>

<script>
	export default {
		name:'Child',
		data() {
			return {
				computer:'华硕-飞行堡垒'
			}
		},
		/* methods: {
			sendComputer2Father(){
				this.$emit('get-computer',this.computer)
			}
		}, */
	}
</script>

<style scoped>
	.child{
		background-color: orange;
		padding: 20px;
	}
</style>